BufferedReader br = new BufferedReader(new FileReader("file.txt"));
try {
    return br.readLine();
} finally {
    if (br != null) br.close(); // 必须显式地保证流会被关闭
}